package com.platform.study.thread.threadpool;

/**
 * Created with IntelliJ IDEA.
 * User: wangyanginfo
 * Date: 13-1-5
 * Time: 下午4:03
 * To change this template use File | Settings | File Templates.
 */
public class ThreadTest extends Thread {

    private int num;
    public ThreadTest(int num){
        this.num = num;
    }

    @Override
    public void run(){
        System.out.println("ThreadTest index: "+num);
        try {
            Thread.sleep(1000);
        } catch (InterruptedException ex) {
        }
    }

    /**
     *
     * @param args
     */
    public static void main(String[] args){
        ThreadPool tp = new ThreadPool(3,10);
        for(int i = 0;i<15;i++){
            ThreadTest test = new ThreadTest(i);
            tp.execute(test);
        }
    }

}
